import axios from '@/libs/api.request'

/**
 * 查询用户列表
 * @param {*} userListVo:
    {
    "enable": true,
    "name": "string",
    "pageNum": 0,
    "pageSize": 0,
    "roleType": "string",
    "schoolId": "string"
    }
 */
export function queryUserManageList (userListVo) {
    return axios.request({
        url: '/userManage/list',
        data: userListVo,
        method: 'post'
    })
}

/**
 * 删除用户信息
 * @param {*} id
 */
export function deleteUserManage (id) {
    return axios.request({
        url: '/userManage/delete',
        params: { id },
        method: 'get'
    })
}

/**
 * 新增用户
 * @param {*} data
 */
export function addUser (data) {
    return axios.request({
        url: '/userManage/add',
        data,
        method: 'post'
    })
}

/**
 * 修改用户
 * @param {*} data
 */
export function updateUser (data) {
    return axios.request({
        url: '/userManage/update',
        data,
        method: 'post'
    })
}

/**
 * 查询用户
 * @param {*} id
 */
export function queryUserInfo (id) {
    return axios.request({
        url: '/userManage/info',
        params: { id },
        method: 'get'
    })
}

export function queryTeacherList (data) {
    return axios.request({
        url: '/userManage/teacherList',
        data,
        method: 'post'
    })
}

export function queryTeaInfo (id) {
    return axios.request({
        url: '/userManage/teacherInfo',
        params: { id },
        method: 'get'
    })
}

export function createTeacher (data) {
    return axios.request({
        url: '/userManage/addTeacher',
        data,
        method: 'post'
    })
}

export function updateTeacher (data) {
    return axios.request({
        url: '/userManage/updateTeacher',
        data,
        method: 'post'
    })
}

export function delTeacher (id) {
    return axios.request({
        url: '/userManage/delTeacher',
        params: { id },
        method: 'get'
    })
}

/**
 * 查询学生列表 模糊查询userName,参数classId
 * @param {Object} data
 */
export function queryStudentList (data) {
    return axios.request({
        url: '/userManage/studentList',
        method: 'post',
        data
    })
}

export function queryStudentInfo (id) {
    return axios.request({
        url: '/userManage/studentInfo',
        method: 'get',
        params: { id }
    })
}

export function delStudent (id) {
    return axios.request({
        url: '/userManage/delStudent',
        method: 'get',
        params: { id }
    })
}

export function addStudent (data) {
    return axios.request({
        url: '/userManage/addStudent',
        method: 'post',
        data
    })
}

export function updateStudent (data) {
    return axios.request({
        url: '/userManage/updateStudent',
        method: 'post',
        data
    })
}
